package com.own.business.level.controller;

import com.own.business.level.business.service.LevelUserHistoryService;
import com.own.business.level.entity.query.LevelUserHistoryQuery;
import com.own.business.level.entity.vo.LevelUserHistoryVo;
import com.own.component.common.base.controller.BaseController;
import com.own.component.common.model.PageModel;
import com.own.component.common.model.R;
import com.own.component.common.model.ResultModel;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * LevelUserHistoryController
 *
 * @author chenxueli
 * @date 2022-07-25 15:16:00
 */
@Api(tags = "用户经验获取流水" + ConstantBeanSuffix.CONTROLLER)
@RestController
@RequestMapping("level/user/history")
public class LevelUserHistoryController extends BaseController {

    @Resource
    private LevelUserHistoryService levelUserHistoryService;

    @ApiOperation(value = "分页查询信息")
    @GetMapping("/page")
    public ResultModel<PageModel<LevelUserHistoryVo>> page(
            @ModelAttribute LevelUserHistoryQuery query
    ) {
        var pageModel = levelUserHistoryService.page(query);
        return R.success(pageModel);
    }

}
